#include "Task.hpp"
#include "ThreadPool.hpp"
#include <memory>

using namespace ThreadPoolMudule;

int main()
{
    LOG(LogLevel::DEBUG)<<"创建进程池";
    std::unique_ptr<ThreadPool<task_t>> tp = std::make_unique<ThreadPool<task_t>>();

    sleep(1);

    LOG(LogLevel::DEBUG)<<"启动进程池";
    tp->Start();

    int cnt = 10;
    while(cnt--)
    {
        tp->Equeue(task);
        sleep(1);
    }

    LOG(LogLevel::DEBUG)<<"停止线程";
    tp->Stop();
 
    sleep(2);

    LOG(LogLevel::DEBUG)<<"回收线程";
    tp->Wait();
    
    return 0;
}


